﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Microsoft.Silverlight.Testing;
using HCMUS_SearchService_Group2;

namespace HCM_SS_UnitTest
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            SystemTray.IsVisible = false;

            var testPage = UnitTestSystem.CreateTestPage() as IMobileTestPage;

            UnitTestSystem.RegisterUnitTestProvider(new Microsoft.Silverlight.Testing.UnitTesting.Metadata.NUnit.NUnitProvider());

            BackKeyPress += (x, xe) => xe.Cancel = testPage.NavigateBack();
            (Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;

            SearchHelper.InitData();
           /* AutoCompleteHelper auto = new AutoCompleteHelper();
            List<string> str = auto.GetSuggest("Atm nguyen");
            str = auto.GetSuggest("at"); 
            str = auto.GetSuggest("Atm nguyen van");            
            str = auto.GetSuggest("Atm nguyen van c");
            str = auto.GetSuggest("Atm qu");
            str = auto.GetSuggest("Atm quan");
            str = auto.GetSuggest("benh vi");
            str = auto.GetSuggest("benh vien");
            str = auto.GetSuggest("benh vien q");
            str = auto.GetSuggest("benh vien qua");
            str = auto.GetSuggest("benh vien quan 5 ph");
            str = auto.GetSuggest("benh vien quan 5 phuong");*/
        }
    }
}